c# add element to array

37

c# append array -

List<int> termsList = new List<int>();
for (int runs = 0; runs < 400; runs++)
{
    termsList.Add(value);
}

// You can convert it back to an array if you would like to
int[] terms = termsList.ToArray();

append an array in c# -

int[] terms = new int[400];
for (int runs = 0; runs < 400; runs++)
{
    terms[runs] = value;
}

addd to array c# -

terms= terms.Append(21).ToArray();

c# how to append in array -

List<string> ls = new List<string>();
ls.Add("Hello");

Comments

Submit
0 Comments